#include <iostream>
#include <ctime>
//[时：分：秒][文件名:行]    [20:14:20][log.cc:22]
#define DBG_LEVEL 0
#define INFO_LEVEL 1
#define ERR_LEVEL 2
#define DEFAULT_LEVEL DBG_LEVEL
#define LOG(log_level, format,...)\
{\                               
        if (log_level >= DEFAULT_LEVEL)\
{\
    time_t t = time(NULL);\
    struct tm *p = localtime(&t);\
    char hms_str[32];\
    strftime(hms_str, 31, "%H:%M:%S", p);\
    printf("[%s][%s:%d] " format "\n", hms_str, __FILE__, __LINE__,##__VA_ARGS__);\
}\
}

#define DLOG(format,...) LOG(DBG_LEVEL,format,##__VA_ARGS__)
#define ILOG(format,...) LOG(INFO_LEVEL,format,##__VA_ARGS__)
#define ELOG(format,...) LOG(ERR_LEVEL,format,##__VA_ARGS__)
int main()
{
    DLOG("hello world");
    return 0;
}